/*
 * Copyright � 2008 Nokia Corporation.
 */


#ifndef SUDOKUSTATISTICCONTROL_H
#define SUDOKUSTATISTICCONTROL_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <coecntrl.h>

class CSudokuContainerControl;
class CFbsBitGc;
class CGraphicEngine;

// CLASS DECLARATION

class CGameTimer : public CTimer
    {
    public:
        static CGameTimer* NewL();
        ~CGameTimer();

    public:
        inline TInt Seconds(){return iSeconds;};
        void Reset();
        void Continue();
        
    private:
        CGameTimer(TInt aPriority);
        void ConstructL();
        
        // From CActive 
        void DoCancel();
        void RunL();
        TInt RunError(TInt aError);

    private:
        TInt iSeconds;
    };



class CSudokuStatisticControl : public CCoeControl
    {
    public:
        ~CSudokuStatisticControl ( );
        static CSudokuStatisticControl* NewL (CSudokuContainerControl& aParent, const TRect& aRect,CFbsBitGc*& aBgc);
        static CSudokuStatisticControl* NewLC (CSudokuContainerControl& aParent, const TRect& aRect,CFbsBitGc*& aBgc);
    
    private:
        CSudokuStatisticControl (CSudokuContainerControl& aParent ,CFbsBitGc*& aBgc);
        void ConstructL (const TRect& aRect);

    public:
        void UpdateData();
        void ResetGameTimer();
        void StopGameTimer();
        void ContinueGameTimer();
        
    private:
        void Draw( const TRect& aRect ) const;
        void DrawStatisticData() const;
        void SizeChanged();
        
    private:
        CSudokuContainerControl&    iParent;
        CFbsBitGc*&                 iBgc;
        TPoint                      iHeadersTl;
        TPoint                      iHeaders2Tl;
        TPoint                      iHeaders3Tl;
        TPoint                      iValuesTl;
        TPoint                      iValues2Tl;
        TPoint                      iValues3Tl;
        CFont*                      iUseFont;
        CGraphicEngine*             iGraphicEngine;
        CGameTimer*                 iGameTimer;
        
        TBuf<5>                     iMoves;
        TBuf<5>                     iEmpty;
        TBuf<20>                    iTime; 
    };

#endif // SUDOKUSTATISTICCONTROL_H
